package mx.com.matersys.vacs.domain;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "registro_lectura")
public class RegistroLectura {
	@Id
	@TableGenerator(name="GEN_REG_LECT", table="sequence", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="SEQ_REG_LECT", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_REG_LECT")
    @Column(name = "idlectura")
    private Integer idlectura;
	
	@OneToMany(mappedBy = "idlectura")
    private Set<Anomalias> anomaliass;
    
    @ManyToOne
    @JoinColumn(name = "idpaciente", referencedColumnName = "id_paciente")
    private Paciente idpaciente;
    
    @Column(name = "hora_registro")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date horaRegistro;
    
    @Column(name = "idevento")
    private Integer idevento;
    
    @Column(name = "registro")
    private byte[] registro;
    
    @Column(name = "reporte_registro", length = 300)
    private String reporteRegistro;
    
    @Column(name = "temperatura_c")
    private Float temperaturaC;
    
    @Column(name = "posicion_latitud")
    private Double posicionLatitud;
    
    @Column(name = "posicion_longitud")
    private Double posicionLongitud;
    
    @Column(name = "hora_transmitida")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date horaTransmitida;
    
    @Column(name = "acelerometro_x")
    private Float acelerometroX;
    
    @Column(name = "acelerometro_y")
    private Float acelerometroY;
    
    @Column(name = "acelerometro_z")
    private Float acelerometroZ;
}
